package com.wz.boot;

import com.wz.boot.core.PrivateMsgForwardCore;
import com.wz.boot.core.ProjectFunctionScanAndInitCore;
import love.forte.simbot.annotation.SimbotResource;
import love.forte.simbot.spring.autoconfigure.EnableSimbot;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.lang.reflect.InvocationTargetException;


@EnableSimbot
@SpringBootApplication(scanBasePackages = "com.wz.boot")
@SimbotResource(value = "application.yml", orIgnore = true)
@MapperScan("com.wz.boot.dao")
public class QQBotApplication {
    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, InstantiationException, IllegalAccessException {
        ConfigurableApplicationContext run = SpringApplication.run(QQBotApplication.class, args);

        //初始化核心配置1
        ProjectFunctionScanAndInitCore.configurableApplicationContext = run;
        ProjectFunctionScanAndInitCore.init();
        //初始化核心配置2
        run.getBean(PrivateMsgForwardCore.class).loadVariableFromMyInit();


    }

}
